﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Commonlib;

namespace AlbonWeb.Manager.OrderManager
{
    public partial class SendEmail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //绑定上页（clothlist）生成的信息（根据不同的布料公司分别生成邮件）
                string cmdstr = "select * from ClothCompany where shortName in(select distinct clothCompany from ClothBuy where statusID=1)";
                SqlHelper.BindRepeater(repMain, SqlHelper.SqlConnectionString, CommandType.Text, cmdstr, null);
            }
        }

        //绑定每封邮件内发送订单的布料信息
        protected void repMain_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            string companyname = ((HiddenField)e.Item.FindControl("hfcompanyname")).Value;
            Repeater repCloth = (Repeater)e.Item.FindControl("repCloth");
            string cmdstr = "select * from ClothBuy where clothCompany='"+companyname+"' and statusID=1";
            SqlHelper.BindRepeater(repCloth, SqlHelper.SqlConnectionString, CommandType.Text, cmdstr, null);
        }
    }
}